#ifndef __MCMATHUTILS_H_
#define __MCMATHUTILS_H_

#define _USE_MATH_DEFINES

#include <math.h>
#include <cmath>

namespace MCMathUtils
{
    static double degreeToRadian(double angle)
    {
        return ((angle * M_PI) / 180.);
    }

    static double radianToDegree(double angle)
    {
        return ((angle * 180.) / M_PI);
    }

    static double normalizeAngle(double angleInRadian)
    {
        angleInRadian = std::fmod(angleInRadian, 2 * M_PI);

        if (angleInRadian < 0)
        {
            angleInRadian += 2 * M_PI;
        }

        return angleInRadian;
    }
}

#endif // !__MCMATHUTILS_H_
